package com.zkjl.protect_business.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zkjl.protect_business.entity.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.util.List;

/**
 * 系统用户表
 * @author lc
 * @date 2019/10/21
 **/
@Data
@ApiModel(description = "用户实体")
@Document(indexName = "pb_user", shards = 1, replicas = 0)
public class User extends BaseEntity {

    /**
     * 用户id
     */
    @Id
    @ApiModelProperty(notes = "id")
    private String id;
    /**
     * 用户名
     */
    @ApiModelProperty(notes = "用户名")
    @Field(name = "user_name")
    private String userName;
    /**
     * 密码
     */
    @ApiModelProperty(notes = "密码")
    @Field(name = "pass_word")
    @JsonIgnore
    private String passWord;
    /**
     * 真实姓名
     */
    @ApiModelProperty(notes = "真实姓名")
    @Field(name = "real_name")
    private String realName;
    /**
     * 头像
     */
    @ApiModelProperty(notes = "头像")
    private String photo;
    /**
     * 年龄
     */
    @ApiModelProperty(notes = "年龄")
    private String age;

    /**
     * 用户角色
     */
    @ApiModelProperty(notes = "用户角色")
    @Field(name = "sys_role_id")
    private String sysRoleId;
    /**
     * 用户角色名称
     */
    @ApiModelProperty(notes = "用户角色名称")
    @Field(name = "sys_role_name")
    private String sysRoleName;

    /**
     * 是否启用
     */
    @ApiModelProperty(notes = "是否启用")
    @Field(name = "if_enable")
    private Boolean ifEnable;
    /**
     * 单位
     */
    @ApiModelProperty(notes = "单位")
    private String org;

    /**
     * 单位
     */
    @ApiModelProperty(notes = "单位id")
    @Field(name = "org_id")
    private String orgId;

    /**
     * 岗位
     */
    @ApiModelProperty(notes = "岗位")
    private String job;
    /**
     * 邮箱
     */
    @ApiModelProperty(notes = "邮箱")
    private String email;
    /**
     * 手机号
     */
    @ApiModelProperty(notes = "手机号")
    private String phone;

    /**
     * 过期时间
     */
    @ApiModelProperty(notes = "过期时间")
    @Field(name = "expire_time")
    private String expireTime;
    /**
     * 开始时间
     */
    @ApiModelProperty(notes = "开始时间")
    @Field(name = "begin_time")
    private String beginTime;

    /**
     * 修改时间
     */
    @ApiModelProperty(notes = "修改时间")
    @Field(name = "update_time")
    private Long updateTime;

    @ApiModelProperty(notes = "权限列表")
    private List<Permission> permissions;


}
